package com.jh.user.repository;

import com.jh.user.pojo.UserBrandJhKey;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface UserBankJhKeyRepository extends JpaRepository<UserBrandJhKey,String>,JpaSpecificationExecutor<UserBrandJhKey> {
    @Query("select bankKey from UserBrandJhKey  bankKey where bankKey.brandId=:brandId and  bankKey.keyPlan=:keyPlan")
    UserBrandJhKey findBankJhKeyByIds(@Param("brandId") long brandid, @Param("keyPlan") String keyPlan);

    UserBrandJhKey findByBrandIdAndKeyPlan(long brandid,String keyPlan);

    List<UserBrandJhKey> findByBrandId(long brandid);

}
